import java.rmi.RemoteException;

/**
 * [Class description]
 * 
 * @author doducviet
 * @version $Revision$
 */
public class AtServerImpl implements AtServer {
    AtClient atClient;

    /**
     * @see AtServer#RegisterClient(AtClient)
     */
    @Override
    public void registerClient(AtClient c) throws RemoteException {
        atClient = c;
    }

    /**
     * @see AtServer#CallServerMethod(java.lang.String)
     */
    @Override
    public void callServerMethod(String message) throws RemoteException {
        System.out.println(message);
        for (int i = 1; i < 10; i++) {
            String msg = "Server response" + Math.random() * 1000;
            atClient.callClientMethod(msg);
        }
    }
}
